package com.monitor.task;

import java.io.Serializable;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.monitor.service.UserService;

public class TimerTask extends QuartzJobBean implements Serializable {

	private static final long serialVersionUID = -8206996626170821638L;
	private UserService userService;

	@Override
	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
		try {
			userService.clearData();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

}
